package com.mlk.rbac.dto;

import java.util.List;

import com.mlk.rbac.po.SysDept;
import org.springframework.beans.BeanUtils;

import com.google.common.collect.Lists;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 组织部门的DTO对象
 * 
 * @author trek
 */
@Getter
@Setter
@ToString
public class DeptTreeDTO extends SysDept {

	/**
	 */
	private static final long serialVersionUID = 331184124928142247L;

	private List<DeptTreeDTO> children = Lists.newArrayList();

	/**
	 * 将po对象转换为DTO对象
	 * 
	 * @param sysDept
	 * @return
	 */
	public static DeptTreeDTO adapt(SysDept sysDept) {
		DeptTreeDTO deptDto = new DeptTreeDTO();
		BeanUtils.copyProperties(sysDept, deptDto);
		return deptDto;
	}

}
